/**
 * create by young (young2f@outlook.com) on 2020/8/16
 */
'use strict';
module.exports = app => {
  const { router, controller } = app;
  router.post('/api/sales/material/used/find', controller.sales.findUsedMaterialRecord);
  router.post('/api/sales/create', controller.sales.create);
  router.post('/api/sales/update', controller.sales.updateOne);
  router.post('/api/sales/delete', controller.sales.deleteOne);
  router.post('/api/sales/review', controller.sales.review);
  router.post('/api/sales/pay/review', controller.sales.payReview);
  router.post('/api/sales/find/many', controller.sales.findMany);
  router.post('/api/sales/find', controller.sales.findOne);
  router.post('/api/sales/history', controller.sales.history);
  router.post('/api/sales/export', controller.sales.export);
  router.post('/api/sales/upload/excel', controller.sales.uploadExcel);
  router.post('/api/sales/statistics/many', controller.sales.findStatisticsMany);
  router.post('/api/sales/rent/create', controller.sales.createRent);
  router.post('/api/sales/rent/delete', controller.sales.deleteRent);
  router.post('/api/sales/rent/update', controller.sales.updateRent);
  router.post('/api/sales/rent/find', controller.sales.findRent);
  router.post('/api/sales/rent/find/many', controller.sales.findRentMany);

  /**
   * 退补货
   */
  router.post('/api/sales/returnOfGoods/find/many', controller.sales.findReturnOrderMany);
  router.post('/api/sales/returnOfGoods/create', controller.sales.createReturnGoodsOrder);
  router.post('/api/sales/returnOfGoods/delete', controller.sales.deleteReturnGoodsOrder);
  router.post('/api/sales/returnOfGoods/update', controller.sales.updateReturnGoodsOrder);
  router.post('/api/sales/returnOfGoods/find', controller.sales.findReturnGoodsOrder);

  router.post('/api/sales/replenish/find/many', controller.sales.findReplenishRecordMany);
  router.post('/api/sales/replenish/create', controller.sales.createReplenishRecord);
  router.post('/api/sales/replenish/delete', controller.sales.deleteReplenishRecord);
  router.post('/api/sales/replenish/update', controller.sales.updateReplenishRecord);
  router.post('/api/sales/replenish/find', controller.sales.findReplenishRecord);

  router.post('/api/sales/prod/find/many', controller.sales.findSalesProdMany);
};
